from run import db
from datetime import datetime

class Admin(db.Model):
    __tablename__ = 'admin'
    id = db.Column(db.INTEGER, primary_key=True)
    name = db.Column(db.String)
    password = db.Column(db.String)
    email = db.Column(db.String)
    adminrank = db.Column(db.INTEGER)
    regtime = db.Column(db.DATETIME)

    def __init__(self, name=None, password=None, email=None, adminrank=None, regtime=datetime.now()):
        self.name = name
        self.password = password
        self.email = email
        self.adminrank = adminrank
        self.regtime = regtime

    def __repr__(self):
        return '<username：{}'.format(self.name)


